home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Day Cry
/
Day Cry CD.bin
/
oh_towns
/
ugoku
/
src.lzh
/
MOVREC
/
MRCXTIF.C
< prev
next >
Wrap
Text File
|
1994-06-01
|
34KB
|
1,393 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include <file_dlg.h>
#include <tifflib.h>
#include <egb.h>
#include <mos.h>
#include <snd.h>
#include "ugoku.h"
#include "video.h"
#include "mrcdef.h"
extern int mouseSwCheck() ;
extern int errorCheck( int ) ;
extern char *guiEgbPtr ; /* EGB é╠âÅü[âNâAâhâîâX */
extern char *rbuf ; /* Ä⌐ë╞É╗é╠âÅü[âNâAâhâîâX */
extern char *bbuf ; /* Ä⌐ë╞É╗é╠âÅü[âNâAâhâîâX */
extern char tifName[][16] ;
extern int tifTotal ;
extern int baseDialogId ;
int tifDialogId[5] = -1 ;
int tifListMenuId0 = -1 ;
int tifScrollBarId0 = -1 ;
int tifMesId[16] = -1 ;
int tifTIconId[2] = -1 ;
int tifDButtonId[9] = -1 ;
int tifListMenuId1 = -1 ;
int tifNumBoxId = -1 ;
int tifScrollBarId1 = -1 ;
int tifWaitDialogId = -1 ;
int xtif, ytif; /* ô╟é▌ì₧é±é╛tifâfü[â^ */
int tifFirstFlg = 0 ; /* ì┼Åëé═0,2ë±û┌ê╚ì~é═-1(tifâfâBâîâNâgâèò╧ìXé╚éτ0) */
static char name[ F_MAX+8 ][20] ;
static int tifCutBuf[ F_MAX+8 ] ;
static int total ;
static int cutNum = 0 ;
static int tifTMode = 0 ;
static int tifPrt0 = 0 ; /* ôoÿ^é│éΩé╜tifé╠ô¬ê╩Æu */
static int tifPrt = 0 ; /* ôoÿ^é│éΩé╜tifé╠î╗ì▌ê╩Æu */
static char tifFilePath[100] ; /* âpâXé≡ò█æ╢ */
tifFileEdit( path )
char *path ;
{
int i, j, n, m ;
char path2[100];
MMI_SendMessage( tifDialogId[0], MM_ATTACH, 1, baseDialogId ) ;
MTL_setFlagObj( tifTIconId[tifTMode+0], (MS_UNSELECT | MS_TOGGLE) ) ;
if( tifFirstFlg == 0 )
{
for( i=0 ; i<80 ; i++ )
{
path2[i] = path[i] ;
tifFilePath[i] = path[i] ;
if( path[i] == '\0' )break ;
}
path2[i++] = '*';
path2[i++] = '.';
path2[i++] = 'T';
path2[i++] = 'I';
path2[i++] = 'F';
path2[i++] = '\0';
total = look_files_all( name, path2 );
look_file_seiri( total, name );
/* âèâXâgâüâjâàü[é╠É▌ÆΦ */
MTL_resetAtrObj(tifListMenuId0, ((~MS_SCROLLL40) & (~MS_MSELECTL40)) );
if( tifTMode )
MTL_setAtrObj(tifListMenuId0, (MS_SCROLLL40 | MS_MSELECTL40) ) ;
else
MTL_setAtrObj(tifListMenuId0, MS_SCROLLL40 ) ;
MMI_SendMessage(tifListMenuId0, MM_SETMAXROWCOLUM, 2, 0, 0) ;
MMI_SendMessage(tifListMenuId0, MM_SETMAXROWCOLUM, 2, total+32, 1) ;
MMI_SendMessage(tifListMenuId0, MM_SETCOLUMLEN, 2, 0, 16) ;
MTL_setAtrObj(tifListMenuId1, (MS_SCROLLL40 | MS_MSELECTL40) ) ;
MMI_SendMessage(tifListMenuId1, MM_SETMAXROWCOLUM, 2, 0, 0) ;
MMI_SendMessage(tifListMenuId1, MM_SETMAXROWCOLUM, 2, F_MAX+32, 1) ;
MMI_SendMessage(tifListMenuId1, MM_SETCOLUMLEN, 2, 0, 16) ;
tifTotal = 0 ;
tifPrt = tifTotal ;
tifPrt0 = 0 ;
tifFirstFlg = -1 ;
for (i = 0 ; i < total ; i++)
MMI_SendMessage(tifListMenuId0, MM_SETROWCOLUM,
3, i, 0, name[i]) ;
n = 24 ; m = total + 23 ;
MMI_SendMessage( tifScrollBarId0, MM_SETSCROLL, 5,
n-1, n-1, (m < n)?(n - 1):(m - 1), n, 4 ) ;
for (i = 0 ; i < tifTotal ; i++)
MMI_SendMessage(tifListMenuId1, MM_SETROWCOLUM,
3, i, 0, tifName[i]) ;
n = 24 ; m = tifTotal + 23 ;
MMI_SendMessage( tifScrollBarId1, MM_SETSCROLL, 5,
n-1, n-1, (m < n)?(n - 1):(m - 1), n, 4 ) ;
}
cutNum = 0 ;
tifFileEditButton( 0 ) ;
MMI_SendMessage( tifDialogId[0], MM_SHOW, 0 ) ; /* î⌐é╣éΘ */
MMI_ExecSystem() ; /* Dialogò\Īé╓ÑÑÑâCâxâôâgâïü[âv */
LISTITEML40 *plitem ;
int maxRow, maxColum ;
MMI_SendMessage( tifListMenuId1, MM_GETLMENUPTR, 3,
&plitem, &maxRow, &maxColum ) ;
for( i=0 ; i<tifTotal ; i++ )
{
for( j=0 ; j<13 ; j++ )
{
tifName[i][j] = (plitem[i].string)[j] ;
if( tifName[i][j] == '\0' )break ;
}
}
MMI_SendMessage( tifDialogId[0], MM_ERASE, 0 ) ;
MMI_SendMessage( tifDialogId[0], MM_DETACH, 0 ) ;
return NOERR ;
}
/* â{â^âôé╠ùLî°Ñû│î°É▌ÆΦâïü[â`âô */
tifFileEditButton( mode ) /* mode!=0é╚éτSHOWé╖éΘ */
int mode ;
{
int i, atr[6], atr2 ;
for( i=0 ; i<6 ; i++ )
{
atr[i] = MS_DSPONLYL40 ;
atr[i] = MTL_checkAtrObj( tifDButtonId[i], atr[i] ) ;
}
MTL_resetAtrObj( tifDButtonId[0], (~MS_DSPONLYL40) ) ; /* 1ü`2bit clear */
MTL_resetAtrObj( tifMesId[0], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifDButtonId[2], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifMesId[2], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifDButtonId[3], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifMesId[3], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifDButtonId[4], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifMesId[4], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifDButtonId[5], (~MS_DSPONLYL40) ) ;
MTL_resetAtrObj( tifMesId[5], (~MS_DSPONLYL40) ) ;
/* êΩèçô]æù */
if( tifTMode == 0 )
{
MTL_setAtrObj( tifDButtonId[0], MS_INACTIVEL40 ) ;
MTL_setAtrObj( tifMesId[0], MS_INACTIVEL40 ) ;
}
else
{
MTL_setAtrObj( tifMesId[0], MS_DSPONLYL40 ) ;
}
/* ò\Ī,ìφÅ£,ĵô╛ */
if( tifTotal == tifPrt )
{
MTL_setAtrObj( tifDButtonId[2], MS_INACTIVEL40 ) ;
MTL_setAtrObj( tifMesId[2], MS_INACTIVEL40 ) ;
MTL_setAtrObj( tifDButtonId[3], MS_INACTIVEL40 ) ;
MTL_setAtrObj( tifMesId[3], MS_INACTIVEL40 ) ;
MTL_setAtrObj( tifDButtonId[4], MS_INACTIVEL40 ) ;
MTL_setAtrObj( tifMesId[4], MS_INACTIVEL40 ) ;
}
else
{
MTL_setAtrObj( tifMesId[2], MS_DSPONLYL40 ) ;
MTL_setAtrObj( tifMesId[3], MS_DSPONLYL40 ) ;
MTL_setAtrObj( tifMesId[4], MS_DSPONLYL40 ) ;
}
/* æ}ôⁿ */
if( cutNum == 0 )
{
MTL_setAtrObj( tifDButtonId[5], MS_INACTIVEL40 ) ;
MTL_setAtrObj( tifMesId[5], MS_INACTIVEL40 ) ;
}
else
{
MTL_setAtrObj( tifMesId[5], MS_DSPONLYL40 ) ;
}
if( mode )
{
for( i=0 ; i<6 ; i++ )
{
atr2 = MS_DSPONLYL40 ;
atr2 = MTL_checkAtrObj( tifDButtonId[i], atr2 ) ;
if( atr2 != atr[i] )
{
MMI_SendMessage( tifDButtonId[i], MM_SHOW, 0 ) ; /* î⌐é╣éΘ */
MMI_SendMessage( tifMesId[i], MM_SHOW, 0 ) ;
}
}
}
return NOERR ;
}
tifFileEditList1()
{
int n, m ;
int prt, max, min, len, page ;
n = 24 ; m = tifTotal + 23 ;
MMI_SendMessage( tifScrollBarId1, MM_SETSCROLL, 5,
n-1, n-1, (m < n)?(n - 1):(m - 1), n, 4 ) ;
MMI_SendMessage( tifNumBoxId, MM_SETNUMBOX, 5,
tifTotal, 0, tifTotal, 1, 0 ) ;
MMI_SendMessage( tifScrollBarId1, MM_GETSCROLL, 5,
&prt, &min, &max, &len, &page ) ;
MMI_SendMessage( tifScrollBarId1, MM_SETSCROLL, 5,
tifPrt0+min, min, max, len, page ) ;
MMI_SendMessage( tifListMenuId1, MM_SETDSPROWCOLUM, 2, tifPrt0, 0 ) ;
MMI_SendMessage( tifNumBoxId, MM_SHOW, 0 ) ;
MMI_SendMessage( tifScrollBarId1, MM_SHOW, 0 ) ;
MMI_SendMessage( tifListMenuId1, MM_SHOW, 0 ) ;
return NOERR ;
}
/* initDataIRCTIF:tifListMenuId0:MJ_LMENUL40é╠î─é╤Åoé╡è╓Éö */
int tifListFunc0(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
if( trigger & MS_EVDRAGOUTL40 )
{
int prt, len, page ;
int max, min ;
int dy ;
POINT *ppt ;
HYPER hyp ;
MMI_SendMessage( kobj, MM_GETHYPER, 1, &hyp ) ;
ppt = ( POINT *)&( pev->info ) ;
dy = 0 ;
if( ppt->y < hyp.fr.lupy )
dy = -1 ;
if( ppt->y > hyp.fr.rdwy )
dy = 1 ;
if( dy )
{
MMI_SendMessage( tifScrollBarId0, MM_GETSCROLL, 5,
&prt, &min, &max, &len, &page ) ;
prt += dy ;
if( (min <= prt) && (prt <= max) )
{
MMI_SendMessage( tifScrollBarId0, MM_SETSCROLL, 5,
prt, min, max, len, page ) ;
MMI_SendMessage( kobj, MM_SETDSPROWCOLUM, 2, prt-min, 0 ) ;
MMI_SendMessage( tifScrollBarId0, MM_SHOW, 0 ) ;
MMI_SendMessage( kobj, MM_SHOW, 0 ) ;
}
}
return NOERR ;
}
if( tifTMode == 0 )
{
LISTITEML40 *plitem0, *plitem1 ;
int maxRow0, maxColum0 ;
int maxRow1, maxColum1 ;
int i, j ;
if( tifTotal >= F_MAX )
return NOERR ;
MMI_SendMessage( kobj, MM_GETLMENUPTR, 3,
&plitem0, &maxRow0, &maxColum0 ) ;
MMI_SendMessage( tifListMenuId1, MM_GETLMENUPTR, 3,
&plitem1, &maxRow1, &maxColum1 ) ;
for( i=0 ; i<total ; i++ )
{
if( plitem0[i].selectFlag )
{
if( tifTotal > tifPrt )
{
for( j=tifTotal ; j>tifPrt ; j-- )
{
if( plitem1[j-1].string != NULL )
{
MMI_SendMessage( tifLi